<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/service/categorys/Category.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/service/categorys/Category.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'CategoryId',
                footer: "Foots",
                cnName: '产品类别',
                name: 'categorys/Category',
                url: "base-write/api/Category/",
                sortName: "CategoryId"
            });
            const editFormFields = ref({"CategoryName":"","PId":[],"CreateTime":"","CategoryRemark":""});
            const editFormOptions = ref([[{"title":"类别名称","field":"CategoryName"}],
                              [{"dataKey":"CategoryCascader","data":[],"title":"上级类别","field":"PId","type":"cascader"}],
                              [{"title":"创建时间","field":"CreateTime","type":"datetime"}],
                              [{"title":"备注","field":"CategoryRemark"}]]);
            const searchFormFields = ref({"CategoryName":"","PId":[]});
            const searchFormOptions = ref([[{"title":"类别名称","field":"CategoryName","type":"like"},{"dataKey":"CategoryCascader","data":[],"title":"上级类别","field":"PId","type":"cascader"}]]);
            const columns = ref([{field:'CategoryId',title:'类别编号',type:'string',width:220,hidden:true,require:true,align:'left'},
                       {field:'CategoryName',title:'类别名称',type:'string',width:220,align:'left',sort:true},
                       {field:'PId',title:'上级类别',type:'string',bind:{ key:'CategoryCascader',data:[]},width:220,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'CategoryRemark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'IsDeleted',title:'IsDeleted',type:'sbyte',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
